package com.bjfu.educms.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bjfu.common_utils.R;
import com.bjfu.educms.entity.CrmBanner;
import com.bjfu.educms.service.CrmBannerService;
import jdk.nashorn.internal.objects.annotations.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *     前台banner显示
 * </p>
 */
@RestController
@RequestMapping("/educms/bannerFront")
//@CrossOrigin
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;

    @Cacheable(value = "banner",key = "'selectIndexList'")
    @GetMapping("getAllbanner")
    public R getAllBanner(){
        List<CrmBanner> list = bannerService.selectAllBanner();
        return R.ok().data("list",list);
    }




}
